import BanksAPI from '@/api/client/bank'
import i18n from "@/lang/index";
const contentConfig = {
  pageName: "sys:user",
  table: {
    border: true,
    highlightCurrentRow: false,
  },
  // defSearch: false,
  indexAction: (data) => {
    return new Promise((resolve, reject) => {
      BanksAPI.getList(data).then((res) => {
        resolve(res)
      }).catch(e => {
        console.log(e);
        reject(e)
      })
    });
  },
  deleteAction: function (id) {
    return new Promise((resolve, reject) => {
      BanksAPI.del(id).then(s => {
        resolve({
          code: "00000",
          data: null,
          msg: i18n.global.t("hint.7"),
        })
      }).catch(e => {
        reject(e)
      })

    });
  },
  exportAction: function (queryParams) {
    // 导出Excel文件
    // return exportUser(queryParams);
  },
  pk: "id",
  toolbar: [
    "refresh",
    // "add",
    // "delete",
    // "export",
    // {
    //   name: "import",
    //   icon: "upload",
    //   text: "导入",
    //   auth: "import",
    // },
  ],
  cols: [
    { label: i18n.global.t("label.15"), align: "center", prop: "user_id",fixed: "left", },
    { label: i18n.global.t("label.9"), align: "center", prop: "user.username", width: 150 ,fixed: "left"},
    { label: i18n.global.t("label.9"), align: "center", prop: "user.username",fixed: "left", },
    { label: i18n.global.t("label.160"), align: "center", prop: "bank.name", },
    { label: i18n.global.t("label.172"), align: "center", prop: "card_holder_name" },
    { label: i18n.global.t("label.173"), align: "center", prop: "is_locked", templet: 'custom', },
    { label: i18n.global.t("label.18"), align: "center", prop: "type", templet: 'custom' },
    { label: i18n.global.t("label.23"), align: "center", prop: "status", templet: 'custom'},
    {
      label: i18n.global.t("label.8"),
      fixed: "right",
      width: 150,
      align: "center",
      templet: "tool",
      operat: [
        'edit',
      ],
    },
  ],
};

export default contentConfig;
